<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head id="Head"><title>
	JSP基本登录模块Ⅴ(防SQL注入攻击)【转】 - Reg - BlogJava
</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta id="metaKeywords" name="keywords" content="JSP基本登录模块Ⅴ(防SQL注入攻击)&lt;font color=red>【转】&lt;/font>" /><link id="MainCss" type="text/css" rel="stylesheet" href="http://www.blogjava.net/Skins/BlackSun/style.css" /><link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="http://www.blogjava.net/Reg/rss.aspx" /></head>
<body>
    <form name="Form1" method="post" action="303575.html" onsubmit="javascript:return WebForm_OnSubmit();" id="Form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="
__VIEWSTATE" value="" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['Form1'];
if (!theForm) {
    theForm = document.Form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<script src="/WebResource.axd?d=PyW-m2hLmppJ9byT1bYEqw2&amp;t=633740135971222506" type="text/javascript"></script>

<script language=JavaScript>
									function ctlent(evt,id)
											{
												if(evt.ctrlKey && evt.keyCode == 13)
												{	
													try
													{
														TempSave(id);
													}
													catch(ex)
													{
													}
													finally
													{
													    __doPostBack('AjaxHolder$PostComment$btnSubmit','')
													}
												}
		
												}</script>
												<script language=JavaScript>function SetReplyAuhor(author){document.getElementById('AjaxHolder_PostComment_tbComment').value+="@"+author+"\n";document.getElementById('AjaxHolder_PostComment_tbComment').focus();return false}</script>
<script src="/ScriptResource.axd?d=Io4r5Qx-zmHVyf9RpZLpA94PR0yylGVrHR75KduCbtx9Wbjv2jQEzXmeH0no0z7nxVOXJo-onw_3WI2pcwKr3w2&amp;t=633740135971222506" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=Io4r5Qx-zmHysvkgwLW9yk7rUGj5M-geQRTOmI9WMPaWNcTLoZx7IpNZpIR4LFVQ0&amp;t=633065726440000000" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=Io4r5Qx-zmHysvkgwLW9yk7rUGj5M-geQRTOmI9WMPaVSfXvXlH0xWaTv3M_TRDPzVKh75E08VU1&amp;t=633065726440000000" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>

        
<div id="top">
	
<div>
	<table class="HeaderTitles">
		<tr>
			<td>
				<h1 class="HeaderTitle"><a id="Header1_HeaderTitle" class="HeaderMainTitle" href="http://www.blogjava.net/Reg/">Reg</a></h1>
				<p id="tagline"></p>
			</td>
		</tr>
	</table>
</div>
<div>
	<table id="HeaderBar" class="HeaderBar">
		<tr>
			<td class="HeaderBarTab" nowrap>
				
&nbsp;
<a id="Header1_MyLinks1_HomeLink" href="http://www.blogjava.net/">BlogJava</a>&nbsp;::
<a id="Header1_MyLinks1_MyHomeLink" href="http://www.blogjava.net/Reg/">首页</a>&nbsp;::
<a id="Header1_MyLinks1_ContactLink" accesskey="9" href="http://www.blogjava.net/Reg/contact.aspx?id=1">联系</a>&nbsp;::
<a id="Header1_MyLinks1_Syndication" href="http://www.blogjava.net/Reg/rss">聚合</a>
<a id="Header1_MyLinks1_XMLLink" class="XMLLink" href="http://www.blogjava.net/Reg/rss"><img src="http://www.blogjava.net/images/xml.gif" style="border-width:0px;" /></a>&nbsp;::
<a id="Header1_MyLinks1_Admin" href="http://www.blogjava.net/Reg/admin/EditPosts.aspx">管理</a>

			</td>
			
			<td class="HeaderBarTabBack" nowrap width="100%">
				

	<table class="BlogStatsBar">
		<tr>
			<td width="100%">
			</td>
			<td class="BlogStatsBar" nowrap>
				&nbsp;
				33 
				Posts&nbsp;::
				1 Stories
				::
				15 Comments
				::
				0 Trackbacks
			</td>
		</tr>
	</table>

			</td>
		</tr>
	</table>
</div>

</div>
<table id="maintable">
	<tr><td id="leftmenu" style="display:none">
	
		
		
<h3>常用链接</h3>
<ul>
		<li><a id="SingleColumn1_ctl00_repeaterLinks_ctl01_lnkLinkItem" href="http://www.blogjava.net/Reg/MyPosts.html">我的随笔</a></li>
	
		<li><a id="SingleColumn1_ctl00_repeaterLinks_ctl02_lnkLinkItem" href="http://www.blogjava.net/Reg/MyArticles.html">我的文章</a></li>
	
		<li><a id="SingleColumn1_ctl00_repeaterLinks_ctl03_lnkLinkItem" href="http://www.blogjava.net/Reg/MyComments.html">我的评论</a></li>
	
		<li><a id="SingleColumn1_ctl00_repeaterLinks_ctl04_lnkLinkItem" href="http://www.blogjava.net/Reg/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn1_ctl00_repeaterLinks_ctl05_lnkLinkItem" href="http://www.blogjava.net/Reg/RecentComments.html">最新评论</a></li>
	</ul>
<H3>留言簿</H3>
<ul>
	<li>
		<a id="SingleColumn1_ctl01_lnkMessages" href="http://www.blogjava.net/Reg/Contact.aspx?id=1">给我留言</a>
	<li>
		<a id="SingleColumn1_ctl01_lnkPublicMsgView" href="http://www.blogjava.net/Reg/default.aspx?opt=msg">查看公开留言</a>
	<li>
		<a id="SingleColumn1_ctl01_lnkPrivateMsgView" href="http://www.blogjava.net/Reg/admin/MyMessages.aspx">查看私人留言</a>
	</li>
</ul>

<H3>我参与的团队</H3>
<div class="RecentComment">
	
</div>

<div class="mainMenuBackground">

		<h3>随笔档案<span style="font-size:11px;font-weight:normal">(33)</span></h3>
		
				<ul>
			
				<li class="menuItemList">
					<a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.blogjava.net/Reg/archive/2010/01.html">2010年1月 (6)</a>
					<span style="width:10px">
						
					</span> 
				</li>
			
				<li class="menuItemList">
					<a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.blogjava.net/Reg/archive/2009/12.html">2009年12月 (4)</a>
					<span style="width:10px">
						
					</span> 
				</li>
			
				<li class="menuItemList">
					<a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.blogjava.net/Reg/archive/2009/11.html">2009年11月 (22)</a>
					<span style="width:10px">
						
					</span> 
				</li>
			
				<li class="menuItemList">
					<a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.blogjava.net/Reg/archive/2009/10.html">2009年10月 (1)</a>
					<span style="width:10px">
						
					</span> 
				</li>
			
				</ul>
			
	
		<h3>文章档案<span style="font-size:11px;font-weight:normal">(1)</span></h3>
		
				<ul>
			
				<li class="menuItemList">
					<a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.blogjava.net/Reg/archives/2009/10.html">2009年10月 (1)</a>
					<span style="width:10px">
						
					</span> 
				</li>
			
				</ul>
			
	
</div>

<script language="JavaScript">
function SearchGoogle(key,evt,site)
		{
			if(evt.keyCode==13 || evt.keyCode==0 || evt.type =='click')
			{
				key.focus();
				var keystr = encodeURIComponent(key.value);
				url = "http://www.google.com/search?q=";
				url = url+keystr;
				url += "&ie=UTF-8&oe=GB2312&hl=zh-CN&domains="+site+"&sitesearch="+site;
				window.location=url;
				return false;
			}
		}
</script>
<H3>搜索</H3>
<ul>
	<li>
		<li><input style="WIDTH: 130px" type="text" name="q" id="q" onkeydown="return SearchGoogle(document.getElementById('q'),event,'www.blogjava.net/Reg')">&nbsp;<input onclick="SearchGoogle(document.getElementById('q'),event,'www.blogjava.net/Reg')" type="button" value="搜索" name="sa">
	</li>
</ul>

<h3>最新评论
	<a id="SingleColumn1__1e53043_RSSHyperlink1" href="http://www.blogjava.net/Reg/CommentsRSS.aspx"><img src="/images/xml.gif" style="border-width:0px;" /></a></h3>
<div class="RecentComment">
	
			<ul>
		
			<li style="word-break:break-all">
				<a id="SingleColumn1__1e53043_CommentList_ctl01_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2010/01/18/302380.html#309965">1. re: 递归树(新思路)[JDBC+Servlet+javaBean](新手版高手勿进)</a>
			</li>
			<li style="word-break:break-all">
				嗯 谢谢指教@来如风<br>
			</li>
			<li style="text-align:right;margin-right:4px">
				--艾波</li>
		
			<li style="word-break:break-all">
				<a id="SingleColumn1__1e53043_CommentList_ctl02_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2010/01/15/302380.html#309711">2. re: 递归树(新思路)[JDBC+Servlet+javaBean](新手版高手勿进)</a>
			</li>
			<li style="word-break:break-all">
				不要一次全加载，用懒加载
			</li>
			<li style="text-align:right;margin-right:4px">
				--来如风</li>
		
			<li style="word-break:break-all">
				<a id="SingleColumn1__1e53043_CommentList_ctl03_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/21/302380.html#303124">3. re: 递归树(新思路)[JDBC+Servlet+javaBean](新手版高手勿进)</a>
			</li>
			<li style="word-break:break-all">
				@onkyo<br>嗯 多谢指教 太感谢你了 我可不可以加你QQ啊 我想多向你请教些技术上面的问题
			</li>
			<li style="text-align:right;margin-right:4px">
				--艾波</li>
		
			<li style="word-break:break-all">
				<a id="SingleColumn1__1e53043_CommentList_ctl04_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/19/302380.html#302912">4. re: 递归树(新思路)[JDBC+Servlet+javaBean](新手版高手勿进)[未登录]</a>
			</li>
			<li style="word-break:break-all">
				评论内容较长,点击标题查看
			</li>
			<li style="text-align:right;margin-right:4px">
				--onkyo</li>
		
			<li style="word-break:break-all">
				<a id="SingleColumn1__1e53043_CommentList_ctl05_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/19/302828.html#302871">5. re: 替换like，使sql语句更有效率【转】</a>
			</li>
			<li style="word-break:break-all">
				请问这个charIndex函数是哪个数据库下的<br>是标准SQL吗？<br>Oracle有对应的函数吗？
			</li>
			<li style="text-align:right;margin-right:4px">
				--yangtao</li>
		
			</ul>
		
</div>

<h3>阅读排行榜</h3>
<div class="RecentComment">
	
			<ul style="word-break:break-all">
		
			<li>
				<a id="SingleColumn1__1c2fc26_TopList_ctl01_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/15/302384.html">1. 父窗体和子窗体传值(js+jquery)(1131)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__1c2fc26_TopList_ctl02_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/15/302383.html">2. 级联菜单(js+jquery+jdbc+servlet)(1009)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__1c2fc26_TopList_ctl03_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/15/302380.html">3. 递归树(新思路)[JDBC+Servlet+javaBean]<font color=red>(新手版高手勿进)</font>(958)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__1c2fc26_TopList_ctl04_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/20/303085.html">4. struts2的s：iterator 标签 详解(313)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__1c2fc26_TopList_ctl05_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/24/303507.html">5. Socket java和flash通信小例子<font color=red>附源码下载</font>(144)</a>
			</li>
		
			</ul>
		
</div>

<h3>评论排行榜</h3>
<div class="RecentComment">
	
			<ul style="word-break:break-all">
		
			<li>
				<a id="SingleColumn1__2f61423_TopList_ctl01_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/15/302380.html">1. 递归树(新思路)[JDBC+Servlet+javaBean]<font color=red>(新手版高手勿进)</font>(10)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__2f61423_TopList_ctl02_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/18/302785.html">2. <font color=#AD842A>配置较全的</font><font color=#F1AF03>log4j.properties</font><font color=red>新手进阶篇</font>(2)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__2f61423_TopList_ctl03_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/10/27/299945.html">3. Java葵花宝典(1)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__2f61423_TopList_ctl04_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/18/302828.html">4. 替换like，使sql语句更有效率<font color=red>【转】</font>(1)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__2f61423_TopList_ctl05_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/11/15/302383.html">5. 级联菜单(js+jquery+jdbc+servlet)(1)</a>
			</li>
		
			</ul>
		
</div>

<h3>60天内阅读排行</h3>
<div class="RecentComment">
	
			<ul>
		
			<li>
				<a id="SingleColumn1__4e2dc4_TopList_ctl01_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/12/14/305913.html">1. Oracle SQL 查询不区分大小写解决方案(java) <font color=red>[贴]</font>(109)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__4e2dc4_TopList_ctl02_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2010/01/19/310119.html">2. ExtJs总结(一)<font color=red>[转]</font>(74)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__4e2dc4_TopList_ctl03_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2009/12/14/305861.html">3. Extjs grid中文排序异常修正<font color=red>[贴]</font>(64)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__4e2dc4_TopList_ctl04_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2010/01/15/309692.html">4. Extjs.grid.Checkbox获值(62)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__4e2dc4_TopList_ctl05_Hyperlink1" href="http://www.blogjava.net/Reg/archive/2010/01/20/310266.html">5. Extjs.grid 详解(58)</a>
			</li>
		
			</ul>
		
</div>
	
</td><td id="main">
	
					
<div class="post">
			<div class="postTitle">
				<a id="viewpost1_TitleUrl" href="http://www.blogjava.net/Reg/archive/2009/11/25/303575.html">JSP基本登录模块Ⅴ(防SQL注入攻击)<font color=red>【转】</font></a>
			</div>
	
	<div class="postText">
		<p>&nbsp;</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 70.83%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; height: 5254px; background-color: #eeeeee"><span style="color: #000000">&nbsp;在JSP基本登录模块Ⅳ中，如果在密码栏输入&#8220;</span><span style="color: #000000">'</span><span style="color: #000000">&nbsp;or&nbsp;</span><span style="color: #000000">'</span><span style="color: #000000">1</span><span style="color: #000000">'</span><span style="color: #000000">=</span><span style="color: #000000">'</span><span style="color: #000000">1</span><span style="color: #000000">&#8221;，我们发现不知道密码也可以登录成功。<br />
这是因为当我们的密码为&#8220;</span><span style="color: #000000">'</span><span style="color: #000000">&nbsp;or&nbsp;</span><span style="color: #000000">'</span><span style="color: #000000">1</span><span style="color: #000000">'</span><span style="color: #000000">=</span><span style="color: #000000">'</span><span style="color: #000000">1</span><span style="color: #000000">&#8221;时，SQL语句变为：<br />
Select&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">&nbsp;FROM&nbsp;member&nbsp;Where&nbsp;username</span><span style="color: #000000">=</span><span style="color: #000000">'</span><span style="color: #000000">magci</span><span style="color: #000000">'</span><span style="color: #000000">&nbsp;and&nbsp;password</span><span style="color: #000000">=</span><span style="color: #000000">''</span><span style="color: #000000">&nbsp;or&nbsp;</span><span style="color: #000000">'</span><span style="color: #000000">1</span><span style="color: #000000">'</span><span style="color: #000000">=</span><span style="color: #000000">'</span><span style="color: #000000">1</span><span style="color: #000000">'</span><span style="color: #000000"><br />
</span><span style="color: #000000">'</span><span style="color: #000000">1</span><span style="color: #000000">'</span><span style="color: #000000">=</span><span style="color: #000000">'</span><span style="color: #000000">1</span><span style="color: #000000">'</span><span style="color: #000000">是永真的，这条SQL语句是能通过验证的。<br />
这就是SQL注入攻击。<br />
<br />
为了防止SQL注入攻击，可以使用PraparedStatement对象操作数据库。<br />
改进后的登录模块如下：<br />
<br />
附加功能：防止SQL注入攻击<br />
<br />
登录模块至少需要以下几个页面：<br />
</span><span style="color: #000000">1</span><span style="color: #000000">.检查Cookie页面(index.jsp)；<br />
</span><span style="color: #000000">2</span><span style="color: #000000">.输入用户信息页面(login.jsp)；<br />
</span><span style="color: #000000">3</span><span style="color: #000000">.用户合法性验证页面(check.jsp)；<br />
</span><span style="color: #000000">4</span><span style="color: #000000">.登录成功欢迎页面(pass.jsp)（检查Session设置）；<br />
</span><span style="color: #000000">5</span><span style="color: #000000">.登录失败提示页面(failure.jsp)；<br />
</span><span style="color: #000000">6</span><span style="color: #000000">.注销登录页面(logout.jsp)。<br />
<br />
数据库：member.mdb<br />
<br />
<br />
结构图：<br />
<br />
</span><span style="color: #000000">---------------------------------------------------------------------</span><span style="color: #000000"><br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index.jsp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">判断Cookie中有无用户名、密码<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">----------------------</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;Y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;N&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;login.jsp</span><span style="color: #000000">&lt;--------------------</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">输入用户名、密码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">----------------&gt;</span><span style="color: #000000">check.jsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">查询用户名、密码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;member.mdb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">返回结果&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check.jsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">判断用户是否合法&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">---------------------</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;Y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;N&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass.jsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;failure.jsp</span><span style="color: #000000">-------&gt;|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;检查session是否含有用户名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">-----------------</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;Y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;N&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass.jsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;跳转</span><span style="color: #000000">-------------------------&gt;|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000">注销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">|</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;logout.jsp</span><span style="color: #000000">------------------------------------&gt;|</span><span style="color: #000000"><br />
<br />
</span><span style="color: #000000">---------------------------------------------------------------------</span><span style="color: #000000"><br />
<br />
index.jsp:<br />
<br />
&nbsp;程序代码<br />
<br />
</span><span style="color: #000000">&lt;%</span><span style="color: #000000">&#64;&nbsp;page&nbsp;contentType</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/html;charset=GB2312</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">index</span><span style="color: #000000">&lt;/</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">初始化,用于保存Cookie中的用户名、密码</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;C_username</span><span style="color: #000000">=</span><span style="color: #000000">""</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;C_password</span><span style="color: #000000">=</span><span style="color: #000000">""</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">获取全部Cookie</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cookie&nbsp;c[]</span><span style="color: #000000">=</span><span style="color: #000000">request.getCookies();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">c.length;i</span><span style="color: #000000">++</span><span style="color: #000000">)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">在Cookie中查找用户名、密码，如果找到，则分别将其赋值给用户名、密码变量</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">.equals(c[i].getName()))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C_username</span><span style="color: #000000">=</span><span style="color: #000000">c[i].getValue();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #000000">"</span><span style="color: #000000">password</span><span style="color: #000000">"</span><span style="color: #000000">.equals(c[i].getName()))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C_password</span><span style="color: #000000">=</span><span style="color: #000000">c[i].getValue();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #000000">!</span><span style="color: #000000">""</span><span style="color: #000000">.equals(C_username)&nbsp;</span><span style="color: #000000">&amp;&amp;</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">!</span><span style="color: #000000">""</span><span style="color: #000000">.equals(C_password))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">Cookie中有用户名、密码,将用户名、密码提交到验证页面</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.sendRedirect(</span><span style="color: #000000">"</span><span style="color: #000000">check.jsp?username=</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">C_username</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">&amp;password=</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">C_password);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">Cookie中没有用户名、密码，跳转到登录页面</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">jsp:forward&nbsp;page</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">login.jsp</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;/</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
<br />
&nbsp;<br />
<br />
login.jsp:<br />
<br />
&nbsp;程序代码<br />
<br />
</span><span style="color: #000000">&lt;%</span><span style="color: #000000">&#64;&nbsp;page&nbsp;contentType</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/html;charset=GB2312</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">登录</span><span style="color: #000000">&lt;/</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">center</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000">登录页面</span><span style="color: #000000">&lt;/</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">hr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">form&nbsp;action</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">check.jsp</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;method</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">post</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">table</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000">用户名：</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;name</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000">密&nbsp;&nbsp;码：</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">password</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;name</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">password</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000">Cookie选项：</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">radio</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;name</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">cookie</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">nosave</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;checked</span><span style="color: #000000">&gt;</span><span style="color: #000000">不保存<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">radio</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;name</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">cookie</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">save</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">保存1分钟<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td&nbsp;colspan</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">2</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;align</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">center</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">submit</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">登录</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">reset</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">重置</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">table</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">form</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">center</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;/</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
<br />
&nbsp;<br />
<br />
check.jsp:<br />
<br />
&nbsp;程序代码<br />
<br />
</span><span style="color: #000000">&lt;%</span><span style="color: #000000">&#64;&nbsp;page&nbsp;contentType</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/html;charset=GB2312</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;%</span><span style="color: #000000">&#64;&nbsp;page&nbsp;</span><span style="color: #0000ff">import</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">java.sql.*</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">验证页面</span><span style="color: #000000">&lt;/</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;Username</span><span style="color: #000000">=</span><span style="color: #000000">request.getParameter(</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;Password</span><span style="color: #000000">=</span><span style="color: #000000">request.getParameter(</span><span style="color: #000000">"</span><span style="color: #000000">password</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;IsCookie</span><span style="color: #000000">=</span><span style="color: #000000">request.getParameter(</span><span style="color: #000000">"</span><span style="color: #000000">cookie</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">定义标志，标记是否为合法用户，true为合法，false为非法</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;isUser</span><span style="color: #000000">=</span><span style="color: #0000ff">false</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">定义数据库连接驱动</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">final</span><span style="color: #000000">&nbsp;String&nbsp;DBDRIVER</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">sun.jdbc.odbc.JdbcOdbcDriver</span><span style="color: #000000">"</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">定义数据库连接地址</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">final</span><span style="color: #000000">&nbsp;String&nbsp;DBURL</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">jdbc:odbc:member</span><span style="color: #000000">"</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">定义变量存放SQL语句</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;sql</span><span style="color: #000000">=</span><span style="color: #0000ff">null</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">定义数据库连接对象</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connection&nbsp;conn</span><span style="color: #000000">=</span><span style="color: #0000ff">null</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">定义数据库操作对象</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PreparedStatement&nbsp;pstmt</span><span style="color: #000000">=</span><span style="color: #0000ff">null</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">定义结果集</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResultSet&nbsp;rs</span><span style="color: #000000">=</span><span style="color: #0000ff">null</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">try</span><span style="color: #000000">{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">加载数据库驱动</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class.forName(DBDRIVER);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">连接数据库</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;conn</span><span style="color: #000000">=</span><span style="color: #000000">DriverManager.getConnection(DBURL);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">预预处SQL语句</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sql</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">Select&nbsp;*&nbsp;FROM&nbsp;member&nbsp;Where&nbsp;username=?&nbsp;and&nbsp;password=?</span><span style="color: #000000">"</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">实例化数据库操作对象</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pstmt</span><span style="color: #000000">=</span><span style="color: #000000">conn.prepareStatement(sql);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">设置psmt中&#8220;?&#8221;对应的变量</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pstmt.setString(</span><span style="color: #000000">1</span><span style="color: #000000">,Username);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pstmt.setString(</span><span style="color: #000000">2</span><span style="color: #000000">,Password);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">查询数据库，返回结果集</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rs</span><span style="color: #000000">=</span><span style="color: #000000">pstmt.executeQuery();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(rs.next())<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">数据库中有符合的记录，合法用户</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isUser</span><span style="color: #000000">=</span><span style="color: #0000ff">true</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">关闭结果集</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rs.close();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">关闭操作</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pstmt.close();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">关闭连接</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;conn.close();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">catch</span><span style="color: #000000">(Exception&nbsp;e)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(e);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">判断用户名、密码的合法性</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(isUser)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">合法用户</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #000000">"</span><span style="color: #000000">save</span><span style="color: #000000">"</span><span style="color: #000000">.equals(IsCookie))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">如果选择了保存Cookie选项，则保存Cookie</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cookie&nbsp;c1</span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;Cookie(</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">,Username);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cookie&nbsp;c2</span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;Cookie(</span><span style="color: #000000">"</span><span style="color: #000000">password</span><span style="color: #000000">"</span><span style="color: #000000">,Password);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">设置Cookie保存时间为1分钟</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c1.setMaxAge(</span><span style="color: #000000">60</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c2.setMaxAge(</span><span style="color: #000000">60</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.addCookie(c1);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.addCookie(c2);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">设置session属性</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.setAttribute(</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">,Username);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">跳转到欢迎页面</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">jsp:forward&nbsp;page</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">pass.jsp</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">非法用户，跳转到登录失败页面</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">jsp:forward&nbsp;page</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">failure.jsp</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;/</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
<br />
&nbsp;<br />
<br />
pass.jsp:<br />
<br />
&nbsp;程序代码<br />
<br />
</span><span style="color: #000000">&lt;%</span><span style="color: #000000">&#64;&nbsp;page&nbsp;contentType</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/html;charset=GB2312</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">登录成功</span><span style="color: #000000">&lt;/</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">center</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">获取session属性值</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;Mem_Session</span><span style="color: #000000">=</span><span style="color: #000000">(String)session.getAttribute(</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(Mem_Session</span><span style="color: #000000">!=</span><span style="color: #0000ff">null</span><span style="color: #000000">)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">session的username属性里含有用户名，可以浏览此页面</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000">登录成功</span><span style="color: #000000">!!&lt;/</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">hr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">h3</span><span style="color: #000000">&gt;</span><span style="color: #000000">欢迎</span><span style="color: #000000">&lt;</span><span style="color: #000000">font&nbsp;size</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">12</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;color</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">red</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%--</span><span style="color: #000000">forward跳转为服务器端跳转，跳转后仍在check.jsp页面，可以继续使用usename参数&nbsp;</span><span style="color: #000000">--%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%=</span><span style="color: #000000">request.getParameter(</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">)&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">font</span><span style="color: #000000">&gt;</span><span style="color: #000000">光临！</span><span style="color: #000000">&lt;/</span><span style="color: #000000">h3</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">p</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">a&nbsp;href</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">logout.jsp</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">注销登录</span><span style="color: #000000">&lt;/</span><span style="color: #000000">a</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">session的username属性里没有正确的用户名，无法浏览此页面，跳转到登录页面</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000">您还没有登录！</span><span style="color: #000000">&lt;/</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3秒之后跳转到登录页面<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">p</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果没有跳转，请点</span><span style="color: #000000">&lt;</span><span style="color: #000000">a&nbsp;href</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">login.jsp</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">这里</span><span style="color: #000000">&lt;/</span><span style="color: #000000">a</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.setHeader(</span><span style="color: #000000">"</span><span style="color: #000000">refresh</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">"</span><span style="color: #000000">3;URL=login.jsp</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">center</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;/</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
<br />
&nbsp;<br />
<br />
failure.jsp:<br />
<br />
&nbsp;程序代码<br />
<br />
</span><span style="color: #000000">&lt;%</span><span style="color: #000000">&#64;&nbsp;page&nbsp;contentType</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/html;charset=GB2312</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">登录失败</span><span style="color: #000000">&lt;/</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">div&nbsp;align</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">center</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000">登录失败</span><span style="color: #000000">!!&lt;/</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">hr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">a&nbsp;href</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">login.jsp</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">重新登录</span><span style="color: #000000">&lt;/</span><span style="color: #000000">a</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">div</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;/</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
<br />
&nbsp;<br />
<br />
logout.jsp:<br />
<br />
&nbsp;程序代码<br />
<br />
</span><span style="color: #000000">&lt;%</span><span style="color: #000000">&#64;&nbsp;page&nbsp;contentType</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/html;charset=GB2312</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">注销登录</span><span style="color: #000000">&lt;/</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">使session失效</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.invalidate();<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">center</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000">注销成功！</span><span style="color: #000000">&lt;/</span><span style="color: #000000">h1</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3秒后跳转到登录页面<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">p</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果没有跳转，请点</span><span style="color: #000000">&lt;</span><span style="color: #000000">a&nbsp;href</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">login.jsp</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">这里</span><span style="color: #000000">&lt;/</span><span style="color: #000000">a</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.setHeader(</span><span style="color: #000000">"</span><span style="color: #000000">refresh</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">"</span><span style="color: #000000">3;URL=login.jsp</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">center</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #000000">&lt;/</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
<br />
&nbsp;<br />
<br />
本文来自CSDN博客，转载请标明出处：http:</span><span style="color: #008000">//</span><span style="color: #008000">blog.csdn.net/samsunge808/archive/2009/02/11/3878091.aspx<br />
</span></div>

	</div>
	
	<div class="postfoot">
		posted on 2009-11-25 10:34 <a href='http://www.blogjava.net/Reg/'>艾波</a> 阅读(79) <a href='#Post'>评论(0)</a> &nbsp;<a href="http://www.blogjava.net/Reg/admin/EditPosts.aspx?postid=303575">编辑</a> &nbsp;<a href="http://www.blogjava.net/Reg/AddToFavorite.aspx?id=303575">收藏</a>  
	</div>
</div>
<img src ="http://www.blogjava.net/Reg/aggbug/303575.html?webview=1" width = "1" height = "1" />

<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.blogjava.net/Reg/archive/2009/11/25/303575.html"
dc:identifier="http://www.blogjava.net/Reg/archive/2009/11/25/303575.html"
dc:title="JSP基本登录模块Ⅴ(防SQL注入攻击)<font color=red>【转】</font>"
trackback:ping="http://www.blogjava.net/Reg/services/trackbacks/303575.aspx" />
</rdf:RDF>
-->

<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('AjaxHolder$scriptmanager1', document.getElementById('Form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tAjaxHolder$UpdatePanel1'], [], [], 90);
//]]>
</script>

<div id="AjaxHolder_UpdatePanel1">
	    
    
<style>
td { font-size: 12px }
.commentTextBox 
{ 
    font-family : Verdana; 
    font-size: 13px;
 }
</style>
<!--Beging Temp Save-->
<STYLE>.userData { BEHAVIOR: url(#default#userdata) }
	</STYLE>
<DIV class="userData" id="CommentsPersistDiv"></DIV>

<script type="text/javascript">
function pageLoad()
{
    Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(handleInitializeRequest);
    //Sys.WebForms.PageRequestManager.getInstance().add_endRequest(handleEndRequest);
}

function handleInitializeRequest(sender, args)
{
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    var eid = args.get_postBackElement().id;
    if (eid.indexOf("DeleteLink")>0) 
    {
       args.get_postBackElement().innerHTML = "<font color='red'>正在删除...</font>";         
    }    
    else if (eid.indexOf("btnSubmit")>0) 
    {
       document.getElementById("AjaxHolder_PostComment_ltSubmitMsg").innerHTML="正在提交...";
       document.getElementById("AjaxHolder_PostComment_btnSubmit").disabled = true;       
    }   
    else if(eid.indexOf("refreshList")>0)
    {
        document.getElementById("AjaxHolder_PostComment_refreshList").innerHTML="<font color='red'>正在刷新...</font>";
    }
   
}	

function TempSave(ElementID)
{
	try
	{
	CommentsPersistDiv.setAttribute("CommentContent",document.getElementById(ElementID).value);
	CommentsPersistDiv.save("CommentXMLStore");
	}
	catch(ex)
	{
	}
	
}
function Restore(ElementID)
{
	CommentsPersistDiv.load("CommentXMLStore");
	document.getElementById(ElementID).value=CommentsPersistDiv.getAttribute("CommentContent");
}	
			
			
</script>
<!--Ene TempSave-->
<div id="divRefreshComments" style="text-align:right;margin-right:10px;margin-bottom:5px;font-size:12px"><a href="http://news.cnblogs.com/">IT新闻</a>&nbsp;&nbsp;<a href="/RequireRegister.aspx">新用户注册</a>&nbsp;&nbsp;<a id="AjaxHolder_PostComment_refreshList" href="javascript:__doPostBack('AjaxHolder$PostComment$refreshList','')">刷新评论列表</a>&nbsp;&nbsp;</div>
<div class="commentform">
<script type="text/javascript" src="http://partner.googleadservices.com/gampad/google_service.js">
</script>
<script type="text/javascript">
try{
  GS_googleAddAdSenseService("ca-pub-4210569241504288");
  GS_googleEnableAllServices();
  } catch (e) { }
</script>
<script type="text/javascript">
try{
  GA_googleAddSlot("ca-pub-4210569241504288", "blogjava_commentbox_up");
  GA_googleAddSlot("ca-pub-4210569241504288", "blogjava_blogpost_bottom");
  GA_googleAddSlot("ca-pub-4210569241504288", "blogjava_blogpost_bottom1");
  } catch (e) { }
</script>
<script type="text/javascript">
try{
  GA_googleFetchAds();
  } catch (e) { }
</script>
<span id="AjaxHolder_PostComment_ltSubmitMsg" style="color:Red;"></span>
<br />
<a name="Feedback"></a>
	<TABLE cellSpacing="1" cellPadding="1" border="0">
		<tr>
		<td colspan="3">
		<div id="itnews_block" style="line-height:180%;" class="other_info_list">IT新闻：<br/>· <a href="http://news.cnblogs.com/n/55846/" target="_blank">团购网站篱笆网无法打开 创始人称因新网故障</a><br/>· <a href="http://news.cnblogs.com/n/55844/" target="_blank">AMD全球CPU 市场份额升至19% 英特尔降至80%</a><br/>· <a href="http://news.cnblogs.com/n/55842/" target="_blank">盖茨的新工作：从印度到尼日利亚的奔忙</a><br/>· <a href="http://news.cnblogs.com/n/55841/" target="_blank">苹果iPad平板机3月1日上市 售价499欧元？</a><br/>· <a href="http://news.cnblogs.com/n/55840/" target="_blank">迅雷自比腾讯和淘宝：可能只是麻痹的幻象</a><br/></div>
		</td>
		</tr>
		<TR>
			<TD colSpan="3">
<script type="text/javascript">
try{
  GA_googleFillSlot("blogjava_commentbox_up");
  } catch (e) { }
</script>
<br/></TD>
		</TR>
		<TR>
			<TD width="75"></TD>
			<TD></TD>
			<TD></TD>
		</TR>
		<TR>
			<TD></TD>
			<TD colSpan="2">
			<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp; <a href="http://news.cnblogs.com" target="_blank">IT新闻</a>&nbsp; <a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp; <a href="http://job.cnblogs.com/cate-java_programmer/" target="_blank">Java程序员招聘</a>&nbsp; <a href="http://a4.yeshj.com/rd/34143/" target="_blank">学英语</a>
			</TD>
		</TR>
		<TR>
			<TD width="55">标题</TD>
			<TD><input name="AjaxHolder$PostComment$tbTitle" type="text" value="re: JSP基本登录模块Ⅴ(防SQL注入攻击)【转】" id="AjaxHolder_PostComment_tbTitle" class="commenttb" style="width:320" /></TD>
			<TD><span id="AjaxHolder_PostComment_RequiredFieldValidator1" style="color:Red;visibility:hidden;">请输入标题</span></TD>
		</TR>
		<TR>
			<TD>姓名</TD>
			<TD><input name="AjaxHolder$PostComment$tbName" type="text" id="AjaxHolder_PostComment_tbName" class="commenttb" style="width:320" /></TD>
			<TD><span id="AjaxHolder_PostComment_RequiredFieldValidator2" style="color:Red;visibility:hidden;">请输入你的姓名</span></TD>
		</TR>
		<TR>
			<TD>主页</TD>
			<TD><input name="AjaxHolder$PostComment$tbUrl" type="text" id="AjaxHolder_PostComment_tbUrl" class="commenttb" style="width:320" /></TD>
			<TD><FONT face="宋体"></FONT></TD>
		</TR>
		<tr>
			<td align="left" colSpan="3">
				<table id="AjaxHolder_PostComment_tbCaptchaImage" class="CommentForm" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td colspan="3">
							<span id="AjaxHolder_PostComment_Requiredfieldvalidator4" style="color:Red;display:none;">请输入验证码</span>
							<span id="AjaxHolder_PostComment_lblImage" style="color:Red;font-weight:bold;"></span>
						</td>
		</tr>
		<tr>
			<td width="78">验证码</td>
			<td><input name="AjaxHolder$PostComment$CodeNumberTextBox" type="text" id="AjaxHolder_PostComment_CodeNumberTextBox" />*&nbsp;&nbsp;<img src="http://www.blogjava.net/Modules/CaptchaImage/JpegImage.aspx?cacheid=20100126150130"/></td>
			<td align="left"></td>
		</tr>
	</table>
	
			</td>
		</tr>
		<TR>
			<TD colSpan="3">内容(请不要发表任何与政治相关的内容)
				<span id="AjaxHolder_PostComment_RequiredFieldValidator3" style="color:Red;visibility:hidden;">请输入评论内容</span><BR>
				<textarea name="AjaxHolder$PostComment$tbComment" rows="10" cols="50" id="AjaxHolder_PostComment_tbComment" class="commentTextBox" onkeydown="ctlent(event,'AjaxHolder_PostComment_tbComment')" style="Width:480;Height:220"></textarea></TD>
		</TR>
		<TR>
			<TD colSpan="3">
		<span id="AjaxHolder_PostComment_Message" style="color:Red;"></span>
		</td>
		<TR>
			<TD colSpan="3"><input id="AjaxHolder_PostComment_chkRemember" type="checkbox" name="AjaxHolder$PostComment$chkRemember" checked="checked" tabindex="-1" /><label for="AjaxHolder_PostComment_chkRemember">Remember Me?</label></TD>
		</TR>
		<TR>
			<TD height="23"><input type="submit" name="AjaxHolder$PostComment$btnSubmit" value="提交" onclick="TempSave('AjaxHolder_PostComment_tbComment');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;AjaxHolder$PostComment$btnSubmit&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="AjaxHolder_PostComment_btnSubmit" class="commentButton" />
				</TD>
			<td colSpan="2" height="23">&nbsp;
				<a id="AjaxHolder_PostComment_lnkLogin" href="http://www.blogjava.net/login.aspx?ReturnURL=http://www.blogjava.net/Reg/archive/2009/11/25/303575.html&amp;SourceURL=/Reg/archive/2009/11/25/303575.html">登录</a>&nbsp;&nbsp;<!--<a id="AjaxHolder_PostComment_linkLoginComment" OnClick="if(document.getElementById('AjaxHolder_PostComment_tbComment').value != '') return confirm('未提交的评论内容将会丢失, 你真的要进入高级评论吗?');" href="http://www.blogjava.net/Reg/archive/2009/11/25/303575.html?login=1#Post">使用高级评论</a>&nbsp;&nbsp;<a href="http://www.blogjava.net/RequireRegister.aspx">新用户注册</a>&nbsp;&nbsp;<A href="#Top">返回页首</A>&nbsp;&nbsp;<a id="AjaxHolder_PostComment_lbRestore" OnClick="Restore('AjaxHolder_PostComment_tbComment'); return false;" href="/Reg/archive/2009/11/25/303575.html#Post">恢复上次提交</a>&nbsp;&nbsp;-->&nbsp;&nbsp;&nbsp;&nbsp;
				</td>
		</TR>
		<TR>
			<TD colSpan="3"><label class="CtrlEnter">[使用Ctrl+Enter键可以直接提交]</label></TD>
		</TR>
		<TR>
			<TD colSpan="3"></TD>
		</TR>
		<!--
		<TR>
			<TD colSpan="3" height="5"></TD>
		</TR>	
		-->
		<tr>
		<td colspan="3">
		<a href="http://a4.yeshj.com/rd/34138/" target="_blank"><span style="color:red">每天10分钟，轻松学英语</span></a>
		</td>
		</tr>
		<TR>
		<TD colSpan="3">
		<script type="text/javascript">
		try{
		  GA_googleFillSlot("blogjava_blogpost_bottom");
		  } catch (e) { }
		</script>
		</TD>
		</TR>
		<tr>			
		<td colspan="3">
		<div id="cnblogs_posts" style="line-height:180%;">博客园首页随笔：<br/>· <a href="http://www.cnblogs.com/kirinboy/archive/2010/01/26/linq-to-sql-update-3.html" target="_blank">使用LINQ to SQL更新数据库（下）：性能测试</a><br/>· <a href="http://www.cnblogs.com/mrhgw/archive/2010/01/26/1656703.html" target="_blank">发布.net项目开发工具新版(版本号：V3.2.60.10，Lucene精灵重大更新)</a><br/>· <a href="http://www.cnblogs.com/gpcuster/archive/2010/01/26/1656702.html" target="_blank">揭秘Google Adwords API</a><br/>· <a href="http://www.cnblogs.com/ysisl/archive/2010/01/26/1656699.html" target="_blank">Silverlight Map 技术点总结</a><br/>· <a href="http://www.cnblogs.com/zhoutian6214/archive/2010/01/26/1656626.html" target="_blank">再谈互联网（最后一次原创）</a><br/></div><div id="job_block" style="line-height:180%;">招聘信息：<br/>· <a href="http://job.cnblogs.com/offer/5056/" target="_blank">高级PHP开发工程师(北京无线天利移动信息技术有限公司)</a><br/>· <a href="http://job.cnblogs.com/offer/4666/" target="_blank">PHP程序员(3966)</a><br/>· <a href="http://job.cnblogs.com/offer/5464/" target="_blank">Cocoa程序员－iphone工程师(杭州香草科技有限公司)</a><br/>· <a href="http://job.cnblogs.com/offer/4562/" target="_blank">测试工程师(178.com)</a><br/>· <a href="http://job.cnblogs.com/offer/4901/" target="_blank">高级IT工程师(北京火星时代科技有限公司)</a><br/></div>
		</td>
		</tr>
		<TR>
		<TD colSpan="3">
<br/>
<script type="text/javascript">
try{
  GA_googleFillSlot("blogjava_blogpost_bottom");
  } catch (e) { }
</script>
<br/>
</TD>
		</TR>
		<TR>
			<TD colSpan="3" height="1">网站导航:<div id="blogsite">
			<a href="http://www.cnblogs.com">博客园</a>&nbsp;&nbsp;
			<a href="http://news.cnblogs.com">IT新闻</a>&nbsp;&nbsp;
			<a href="http://home.cnblogs.com">个人主页</a>&nbsp;&nbsp;
			<a href="http://www.cnweblog.com">博客生活</a>&nbsp;&nbsp;
			<a href="http://www.cnitblog.com">IT博客网</a>&nbsp;&nbsp;
			<a href="http://www.cppblog.com">C++博客</a>&nbsp;&nbsp;
			<a href="http://space.cnblogs.com">博客园社区</a>
			<a href="/Reg/archive/2009/11/25/303575.html?opt=admin">管理</a>
			</div>
		</TD>
		</TR>
		<TR>
			<TD colSpan="3" height="5"></TD>
		</TR>	
		<TR>
			<TD colSpan="3">&nbsp;</TD>
		</TR>
		<TR>
			<TD colSpan="3" height="5"></TD>
		</TR>
		<TR>
			<TD colSpan="3">
				</TD>
		</TR>		
	</TABLE>	
</div>
<div id="AjaxHolder_PostComment_ValidationSummary1" style="color:Red;display:none;">

	</div>

</div>

				
</tr>
</table>

<p id="footer">
	Copyright @
	艾波<BR>
	Powered by:
	<a href="http://scottwater.com/blog" target=_blank>.Text</a> and 
	<a href="http://asp.net" target=_blank>ASP.NET</a>
	<br>
	Theme by: <a href="http://www.DotNetMonster.com" target=_blank>.NET Monster</a>
</p>


    
<script type="text/javascript">
//<![CDATA[
var Page_ValidationSummaries =  new Array(document.getElementById("AjaxHolder_PostComment_ValidationSummary1"));
var Page_Validators =  new Array(document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator1"), document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator2"), document.getElementById("AjaxHolder_PostComment_Requiredfieldvalidator4"), document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator3"));
//]]>
</script>

<script type="text/javascript">
//<![CDATA[
var AjaxHolder_PostComment_RequiredFieldValidator1 = document.all ? document.all["AjaxHolder_PostComment_RequiredFieldValidator1"] : document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator1");
AjaxHolder_PostComment_RequiredFieldValidator1.controltovalidate = "AjaxHolder_PostComment_tbTitle";
AjaxHolder_PostComment_RequiredFieldValidator1.errormessage = "请输入标题";
AjaxHolder_PostComment_RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
AjaxHolder_PostComment_RequiredFieldValidator1.initialvalue = "";
var AjaxHolder_PostComment_RequiredFieldValidator2 = document.all ? document.all["AjaxHolder_PostComment_RequiredFieldValidator2"] : document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator2");
AjaxHolder_PostComment_RequiredFieldValidator2.controltovalidate = "AjaxHolder_PostComment_tbName";
AjaxHolder_PostComment_RequiredFieldValidator2.errormessage = "请输入你的姓名";
AjaxHolder_PostComment_RequiredFieldValidator2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
AjaxHolder_PostComment_RequiredFieldValidator2.initialvalue = "";
var AjaxHolder_PostComment_Requiredfieldvalidator4 = document.all ? document.all["AjaxHolder_PostComment_Requiredfieldvalidator4"] : document.getElementById("AjaxHolder_PostComment_Requiredfieldvalidator4");
AjaxHolder_PostComment_Requiredfieldvalidator4.controltovalidate = "AjaxHolder_PostComment_CodeNumberTextBox";
AjaxHolder_PostComment_Requiredfieldvalidator4.errormessage = "请输入验证码";
AjaxHolder_PostComment_Requiredfieldvalidator4.display = "Dynamic";
AjaxHolder_PostComment_Requiredfieldvalidator4.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
AjaxHolder_PostComment_Requiredfieldvalidator4.initialvalue = "";
var AjaxHolder_PostComment_RequiredFieldValidator3 = document.all ? document.all["AjaxHolder_PostComment_RequiredFieldValidator3"] : document.getElementById("AjaxHolder_PostComment_RequiredFieldValidator3");
AjaxHolder_PostComment_RequiredFieldValidator3.controltovalidate = "AjaxHolder_PostComment_tbComment";
AjaxHolder_PostComment_RequiredFieldValidator3.errormessage = "请输入评论内容";
AjaxHolder_PostComment_RequiredFieldValidator3.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
AjaxHolder_PostComment_RequiredFieldValidator3.initialvalue = "";
var AjaxHolder_PostComment_ValidationSummary1 = document.all ? document.all["AjaxHolder_PostComment_ValidationSummary1"] : document.getElementById("AjaxHolder_PostComment_ValidationSummary1");
AjaxHolder_PostComment_ValidationSummary1.showmessagebox = "True";
AjaxHolder_PostComment_ValidationSummary1.showsummary = "False";
//]]>
</script>


<script type="text/javascript">
//<![CDATA[

var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
        
document.getElementById('AjaxHolder_PostComment_ValidationSummary1').dispose = function() {
    Array.remove(Page_ValidationSummaries, document.getElementById('AjaxHolder_PostComment_ValidationSummary1'));
}
Sys.Application.initialize();

document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator1').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator1'));
}

document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator2').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator2'));
}

document.getElementById('AjaxHolder_PostComment_Requiredfieldvalidator4').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('AjaxHolder_PostComment_Requiredfieldvalidator4'));
}

document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator3').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('AjaxHolder_PostComment_RequiredFieldValidator3'));
}
//]]>
</script>
</form>
    <script type="text/javascript" src="/script/ShowHidden.js"></script>
	<script type="text/javascript">
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	<script type="text/javascript">
	try {
	var pageTracker = _gat._getTracker("UA-476124-3");
	pageTracker._trackPageview();
	} catch(err) {}</script>
</body>
</html>
